<%@ page contentType="text/html;charset=utf-8" %>
<%@ page import="cn.js.fan.db.*"%>
<%@ page import="cn.js.fan.web.*"%>
<%@ page import="cn.js.fan.db.Paginator"%>
<%@ page import="cn.js.fan.util.*"%>
<%@ page import="java.util.*"%>
<%@ page import="java.sql.*"%>
<%@ page import="cn.js.fan.security.*"%>
<%@ page import="com.redmoon.forum.util.*"%>
<%@ page import="com.cloudwebsoft.framework.db.JdbcTemplate" %>
<%@ page import="com.cloudwebsoft.framework.db.DataSource" %>
<%@ page import="com.redmoon.oa.flow.*" %>
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title><%=Global.AppName%> - <%=Global.server%></title>
<style type="text/css">
<!--
body {
	margin-top: 0px;
	margin-bottom: 0px;
}
-->
</style>
<link href="css.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
body,td,th {
	font-size: 12px;
}
-->
</style>
<link href="index.css" rel="stylesheet" type="text/css">
</head>

<body>
<%
    FormParser formParser = new FormParser();
    JdbcTemplate jt = new JdbcTemplate();
    String sql = "select name,formCode from form_field where type='macro' and macroType='macro_flow_number'";
    ResultIterator ri = jt.executeQuery(sql);
    while (ri.hasNext()) {
        ResultRecord rr = (ResultRecord)ri.next();
        String name = rr.getString(1);
        String formCode = rr.getString(2);
        FormDb fd = new FormDb();
        fd = fd.getFormDb(formCode);
        formParser.setFieldAttribute(fd, name, "macrodefaultvalue", "1");
        formParser.setFieldAttribute(fd, name, "description", "1");

        sql = "update form_field set defaultValue='1',description='1' where formCode=? and name=?";
        int r = jt.executeUpdate(sql, new Object[]{formCode, name});
        out.print("formCode=" + formCode + " name=" + name + " r=" + r + "<br/>");
        FormCache mc = new FormCache(fd);
        PrimaryKey primaryKey = new PrimaryKey();
        primaryKey.setValue(formCode);
        mc.refreshSave(primaryKey);
    }
%>
</body>
</html>
